:root {
	--rgh-green: var(--fgColor-success, var(--color-success-fg, #1a7f37));
	--rgh-red: var(--fgColor-danger, var(--color-danger-fg, #cf222e));
	--rgh-border-color: var(
		--borderColor-muted,
		var(--color-border-muted, #d8dee4)
	);
	--rgh-background: var(--bgColor-default, var(--color-canvas-default, #fff));
}

/* For `open-all-selected` and `pr-filters`: set a reduced padding for all buttons for #1830 and #1904 */
#js-issues-toolbar .table-list-header-toggle details {
	padding: 0 !important;
}

#js-issues-toolbar .table-list-header-toggle summary {
	padding-left: 8px !important;
	padding-right: 8px !important;
}

#js-issues-toolbar .table-list-header-toggle > :last-child > summary {
	padding-right: 0 !important;
}

/* For `open-all-notifications` and `select-notifications`: allow header wrapping #5705

Selector works on:
https://github.com/notifications (Grouped by date)
https://github.com/notifications (Grouped by repo)
https://github.com/notifications?query=reason%3Acomment (which is an unsaved filter)
*/
.js-check-all-container .js-bulk-action-toasts ~ div .Box-header {
	flex-wrap: wrap;
	height: auto !important; /* Unset the default height to allow wrapping */
	min-height: 52px; /* Re-set the default height as a minimum height */
}

:is(
		.js-notifications-mark-selected-actions,
		.js-notifications-mark-all-actions
	):not([hidden]) {
	display: contents !important;
}

/* Smoothen mouse animation on 404 pages */
.js-plaxify {
	transition: transform 0.1s;
}

[alt='404 “This is not the web page you are looking for”'] {
	animation: fade-in 2s ease-out;
}

/* Lighten deletions in Markdown */
.markdown-body del {
	color: var(--fgColor-muted, var(--color-fg-muted));
}

/* Make <details> visibly clickable */
.markdown-body summary, /* Summary elements are always clickable when present */
.markdown-body details:not([open]) {
	/* Summary-less details have unselectable clickable elements */
	cursor: pointer;
}

/* Remove the "New repository" button in the dashboard sidebar */
.dashboard-sidebar a.Button[href='/new'] {
	display: none;
}

/* Expand empty diffs in PRs */
:root .file .data.empty {
	padding: 54px;
	text-align: center;
}

:root .file .data table {
	text-align: left;
}

/* Improve dropdown expansion animation (e.g. top-right dropdown in comments) */
/* It normally pops in from the center */
.dropdown-menu-sw {
	transform-origin: 90% top;
}

/* Improve spacing in conversation lists meta, made feel crowded by:
highlight-collaborators-and-own-conversations
parse-backticks
pr-branches
*/
.js-issue-row .text-small.color-fg-muted {
	line-height: 1.8;
}

/* Reset `vertical-align` for .octicons to work with above increased line-height */
.js-issue-row .text-small.color-fg-muted .octicon {
	vertical-align: middle;
}

/* Hide duplicate "You can also open this in GitHub Desktop" in PRs’ mergeability box */
#partial-pull-merging .js-remove-unless-platform {
	display: none;
}

/* Increase scrollable area in GitHub Actions #3591 */
.WorkflowRunLogsScroll {
	height: auto !important;
}

/* Keep diff stats in "Jump to" dropdown when the header is fixed #3925 */
.select-menu-item-text .diffstat {
	display: inline !important;
}

/* Style the "Find feature" dialog that appears on top of the page */
#rgh-bisect-dialog {
	position: fixed;
	bottom: 50%;
	right: 50%;
	transform: translate(50%, 50%);
	min-width: 380px; /* Avoids a width change on the last step which causes the YES button to be where NO was */
	box-shadow: var(
		--shadow-floating-large,
		var(--color-shadow-large, var(--color-toast-shadow))
	);
	z-index: 2147483647;
}

/* Space out "Edit" and "Open with" buttons on PR page, also for `view-last-pr-deployment` #4281 */
.gh-header-actions [aria-label='Edit Pull Request title'] {
	margin-left: 4px !important;
	margin-right: 4px !important;
}

/* Remove the underline on PR filename copy button hover #4871 */
.file-header .file-info clipboard-copy {
	display: inline-block;
}

/* Ensure all buttons in the repo file navigation header are aligned in the center rather than to the top */
.file-navigation.flex-items-start {
	align-items: center !important;
}

/* Bold username in conversation lists #4899 */
:is(.js-issue-row, .js-pinned-issue-list-item) [data-hovercard-type='user'] {
	font-weight: 600;
}

/* Fit large images in the window when viewing single files */
div[data-target='readme-toc.content'] div.blob-wrapper img {
	max-width: 100%;
}

/* Hide label on Milestones link if there are zero milestones #5120 */
[data-selected-links^='repo_milestones ']:has([title='0']) {
	width: 36px; /* Size it so only the icon is visible */
	overflow: hidden; /* Crop the text out */
	padding-left: 10px;
}

[data-selected-links^='repo_milestones ']:has([title='0']) svg {
	margin-right: 20px; /* Push the text farther away from the text so it's cropped out */
}

/* Add override for CSS-in-JS components that don't use regular .btn styles */
.BtnGroup-item:last-child:not(:first-child) {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.rgh-bg-none {
	background: none !important;
}

.rgh-z-index-5 {
	position: relative;
	z-index: 5;
}
